<template>
	<view class="bgtmert">
		<uni-list>
			<uni-list-item title="" note="" v-for="sd in datas" @tap="urllx(sd.id,sd.name)">{{sd.name}}</uni-list-item>
		</uni-list>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				titile:'',
				datas:{}
			}
		},
		components: {
			
		},
		onLoad(e) {
			 
			console.log(e);
			uni.setNavigationBarTitle({
				title:e.titile
			})
			this.titile = e.titile
			this.getssq(e.pid)
		},
		methods: {
			tiaozs() {
				this.$store.state.testform.jhhgdfb = this.titile
				uni.redirectTo({
					url:'/pages/test'
				})
			},
			async getssq(id){
				var that = this
				let urls = '/api/model/'+id
				let datas =  await this.get(urls)
				uni.showLoading()
				let brands = datas.data
				that.datas = brands;
				// for(var j in brands){
				// 	let jsons = {}
				//     jsons.letter = j
				//     jsons.data = brands[j]
				// 	that.datas.push(jsons)
				// }
				uni.hideLoading()
				console.log(that.datas);
					// that.datas = brands
			},
			urllx(pid,name){
				uni.$emit('carbrand', {'type':3,id:pid,name:name});
				// 在C页面内 navigateBack，将返回A页面
				uni.navigateBack({
				    delta: 3
				});
			}
		},
		mounted() {
			
		}
	}
</script>
<style scoped>
	
</style>
